'use strict';
exports.main = async (event, context) => {
	//event为客户端上传的参数
	let user_id = (new Date().getTime().toString().slice(-4)) + "_" + (Math.random().toString().slice(2));
	let user_create_time= new Date().getTime() 
	console.log('event : ', event)
	const db = uniCloud.database();
	const User = db.collection('db_user')
	let {username,account,password,user_img,user_sex,user_sign} =event
	console.log(username,account,password)
	
	//返回数据给客户端
	return User.add({
		user_id,
		user_create_time,
		username,
		account,
		password,
		user_img,
		user_sex,
		user_sign
	})
};
